<?php

namespace App\Models\Traits;

trait ScopeTrashedTrait
{
    public static $trashedTypes = ['未删除', '包含已删除', '仅已删除'];

    public function scopeTrashedType($query, $type)
    {
        switch ($type) {
            case 1:
                $query = $query->withTrashed();
                break;
            case 2:
                $query = $query->onlyTrashed();
                break;
            case 0:
            default:
        }

        return $query;
    }
}